home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / answrbok / 6_17.lha / 6_17 / 6_17a18.c < prev    next >
C/C++ Source or Header  |  1993-08-08  |  399b  |  19 lines

  1. * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
  2. * The C++ Answer Book */
  3. * Tony Hansen */
  4. * All rights reserved. */
  5. / x = (v1 != v2)
  6. nt operator!=(vector &v1, vector &v2)
  7.  
  8.    if (v1.p->length != v2.p->length)
  9. return 1;
  10.  
  11.    int l = v1.p->length;
  12.    float *f1 = v1.p->f;
  13.    float *f2 = v2.p->f;
  14.    for (int i = 0; i < l; i++)
  15. if (*f1++ != *f2++)
  16.     return 1;
  17.    return 0;
  18.  
  19.